/*
 * constantes.h
 *
 *  Created on: 03/10/2010
 *      Author: teledhil
 */

#ifndef CONSTANTES_H_
#define CONSTANTES_H_

#define BUFFER 320
#define BIG_BUFFER 1024
#define REALLY_BIG_BUFFER 10240
#define I_DONT_THINK_YOU_NEED_A_BUFFER_SO_BIG 1024000

/*======================*/
/*OPCIONES DE ARGUMENTOS*/
/*======================*/
#define OPTION_HOST_PORT "-s"	/*<host:port>
	Automatically connects to the IRC server on <host:port>.*/
#define OPTION_NICK "-n"	/*<nick>
	      Sets  the  nickname  to  <nick>.	 The  rest  of	the parameters
	      required for registration (username, realname) are also  set  to
	      this value.*/
#define OPTION_CHANNEL "-c"	/*<channel>
	      Automatically joins <channel>.*/
#define OPTION_DEBBUG "-d"	/*Debug  mode.   Developers  use this option to show debug traces,
	      that a normal user MUST NOT see.*/

/*======================*/
/*MENSAJES*/
/*======================*/
#define ERROR_NOT_CONNECTED_TO_SERVER "Not connected to irc server"
#define ERROR_NOT_CONNECTED_TO_SERVER "Not connected to irc server"

/*======================*/
/*COMANDOS IRC*/
/*======================*/
#define COMMAND_CHARACTER '/'
#define COMANDO_HELP "/help"	/*Shows help*/
#define COMANDO_CONNECT "/connect"	/*<host:port>
	Connects to the IRC server on <host:port>.*/
#define COMANDO_AUTH "/auth"	/*<nick>
	Authenticates with the server, sets nickname, username and  real
	name to <nick>.*/
#define COMANDO_LIST "/list"	/*Lists all current IRC channels, number of users, and topic.*/
#define COMANDO_JOIN "/join"	/*[<channel>]
	Joins  channel  <channel>.  In case no <channel> is provided, it
	simply tells which is the current  channel. If the user was
	already  in a channel, this command make the user leave the cur-
	rent channel and join the new one.*/
#define COMANDO_LEAVE "/leave"	/*Leaves your current channel.*/
#define COMANDO_PART "/part"	/*Leaves your current channel.*/
#define COMANDO_PING "/ping"	/*Pings.*/
#define COMANDO_PONG "/pong"	/*Pongs.*/
#define COMANDO_WHO "/who"	/*Lists users in current channel.*/
#define COMANDO_MSG "/msg"	/*<text>
	Sends <txt> to the current channel.*/
#define COMANDO_DISCONNECT "/disconnect"	/*Disconnects from server.*/
#define COMANDO_QUIT "/quit"	/*Closes program.*/
#define COMANDO_NOP "/nop"	/*[<text>]
	(Debugging) no operation, just echoes <text> back.*/
#define COMANDO_SLEEP "/sleep"	/*[<secs>]
	(Debugging) pauses for <secs> seconds.*/
#define COMANDO_OFFER "/offer"	/*<filename> <nick>
	Launch a DCC server for a file  transfer.   The  recipient  must
	accept your offer with a /download command.*/
#define COMANDO_DOWNLOAD "/download"	/*<filename> <host:port>
	Starts  a file transfer by direct client connection.  The sender
	must first have offered the file with an /offer command.*/

/*======================*/
/*PROTOCOLO IRC*/
/*======================*/

#define MAX_LONG_IRC_MESSAGE 512

#define COLON 0x3a // ":"
#define SPACE 0x20 // " "
#define CR 0x0d // " " <-- No, es broma :D
#define LF 0x0a // " " <-- No, es broma :D
#define IRC_ERROR "ERROR"
#define IRC_KICK "KICK"
#define IRC_JOIN "JOIN"
#define IRC_LIST "LIST"
#define IRC_LUSERS "LUSERS"
#define IRC_MODE "MODE"
#define IRC_MOTD "MOTD"
#define IRC_NAMES "NAMES"
#define IRC_NICK "NICK"
#define IRC_NOTICE "NOTICE"
#define IRC_OPER "OPER"
#define IRC_PART "PART"
#define IRC_PASS "PASS"
#define IRC_PING "PING"
#define IRC_PONG "PONG"
#define IRC_PRIVMSG "PRIVMSG"
#define IRC_QUIT "QUIT"
#define IRC_SERVICE "SERVICE"
#define IRC_SQUIT "SQUIT"
#define IRC_STATS "STATS"
#define IRC_TOPIC "TOPIC"
#define IRC_USER "USER"
#define IRC_VERSION "VERSION"
#define IRC_WHO "WHO"

#define IRC_DISCONNECTING "Disconnecting"

/*RESPUESTAS DEL SERVIDOR*/
/*======================*/
#define RPL_WELCOME "001"	/*"Welcome to the Internet Relay Network
							   <nick>!<user>@<host>*/
#define RPL_YOURHOST "002"	/*"Your host is <servername>, running version <ver>"*/
#define RPL_CREATED "003"
#define RPL_MYINFO "004"
#define RPL_BOUNCE "005"

#define RPL_TRACELINK "200"
#define RPL_TRACECONNECTING "201"
#define RPL_TRACEHANDSHAKE "202"
#define RPL_TRACEUNKNOWN "203"
#define RPL_TRACEOPERATOR "204"
#define RPL_TRACEUSER "205"
#define RPL_TRACESERVER "206"
#define RPL_TRACESERVICE "207"
#define RPL_TRACENEWTYPE "208"
#define RPL_TRACECLASS "209"
#define RPL_TRACERECONNECT "210"
#define RPL_STATSLINKINFO "211"
#define RPL_STATSCOMMANDS "212"
#define RPL_ENDOFSTATS "219"
#define RPL_UMODEIS "221"
#define RPL_SERVLIST "234"
#define RPL_SERVLISTEND "235"

#define RPL_STATSUPTIME "242"
#define RPL_STATSOLINE "243"
#define RPL_STATSDLINE "250"
#define RPL_LUSERCLIENT "251"
#define RPL_LUSEROP "252"
#define RPL_LUSERUNKNOWN "253"
#define RPL_LUSERCHANNELS "254"
#define RPL_LUSERME "255"
#define RPL_ADMINME "256"
#define RPL_ADMINLOC1 "257"
#define RPL_ADMINLOC2 "258"
#define RPL_ADMINEMAIL "259"

#define RPL_TRACELOG "261"
#define RPL_TRACEEND "262"
#define RPL_TRYAGAIN "263"
#define RPL_265 "265"
#define RPL_266 "266"

#define RPL_AWAY "301"
#define RPL_USERHOST "302"
#define RPL_ISON "303"
#define RPL_UNAWAY "305"
#define RPL_NOWAWAY "306"
#define RPL_WHOISUSER "311"
#define RPL_WHOISSERVER "312"
#define RPL_WHOISOPERATOR "313"
#define RPL_WHOWASUSER "314"
#define RPL_ENDOFWHO "315"
#define RPL_WHOISIDLE "317"
#define RPL_ENDOFWHOIS "318"
#define RPL_WHOISCHANNELS "319"
#define RPL_LISTSTART "321"
#define RPL_LIST "322"
#define RPL_LISTEND "323"
#define RPL_CHANNELMODEIS "324"
#define RPL_UNIQOPIS "325"
#define RPL_NOTOPIC "331"
#define RPL_TOPIC "332"
#define RPL_INVITING "341"
#define RPL_SUMMONING "342"
#define RPL_INVITELIST "346"
#define RPL_ENDOFINVITELIST "347"
#define RPL_EXCEPTLIST "348"
#define RPL_ENDOFEXCEPTLIST "349"
#define RPL_VERSION "351"
#define RPL_WHOREPLY "352"
#define RPL_NAMREPLY "353"
#define RPL_LINKS "364"
#define RPL_ENDOFLINKS "365"
#define RPL_ENDOFNAMES "366"
#define RPL_BANLIST "367"
#define RPL_ENDOFBANLIST "368"
#define RPL_ENDOFWHOWAS "369"
#define RPL_INFO "371"
#define RPL_MOTD "372"
#define RPL_ENDOFINFO "374"
#define RPL_MOTDSTART "375"
#define RPL_ENDOFMOTD "376"
#define RPL_YOUREOPER "381"
#define RPL_REHASHING "382"
#define RPL_YOURESERVICE "383"
#define RPL_TIME "391"
#define RPL_USERSSTART "392"
#define RPL_USERS "393"
#define RPL_ENDOFUSERS "394"
#define RPL_NOUSERS "395"

#define ERR_NOSUCHNICK "401"
#define ERR_NOSUCHSERVER "402"
#define ERR_NOSUCHCHANNEL "403"
#define ERR_CANNOTSENDTOCHAN "404"
#define ERR_TOOMANYCHANNELS "405"
#define ERR_WASNOSUCHNICK "406"
#define ERR_TOOMANYTARGETS "407"
#define ERR_NOSUCHSERVICE "408"
#define ERR_NOORIGIN "409"
#define ERR_NORECIPIENT "411"
#define ERR_NOTEXTTOSEND "412"
#define ERR_NOTOPLEVEL "413"
#define ERR_WILDTOPLEVEL "414"
#define ERR_BADMASK "415"
#define ERR_UNKNOWNCOMMAND "421"
#define ERR_NOMOTD "422"
#define ERR_NOADMININFO "423"
#define ERR_FILEERROR "424"
#define ERR_NONICKNAMEGIVEN "431"
#define ERR_ERRONEUSNICKNAME "432"
#define ERR_NICKNAMEINUSE "433"
#define ERR_NICKCOLLISION "436"
#define ERR_UNAVAILRESOURCE "437"
#define ERR_USERNOTINCHANNEL "441"
#define ERR_NOTONCHANNEL "442"
#define ERR_USERONCHANNEL "443"
#define ERR_NOLOGIN "444"
#define ERR_SUMMONDISABLED "445"
#define ERR_USERSDISABLED "446"
#define ERR_NOTREGISTERED "451"
#define ERR_NEEDMOREPARAMS "461"
#define ERR_ALREADYREGISTRED "462"
#define ERR_NOPERMFORHOST "463"
#define ERR_PASSWDMISMATCH "464"
#define ERR_YOUREBANNEDCREEP "465"
#define ERR_YOUWILLBEBANNED "466"
#define ERR_KEYSET "467"
#define ERR_CHANNELISFULL "471"
#define ERR_UNKNOWNMODE "472"
#define ERR_INVITEONLYCHAN "473"
#define ERR_BANNEDFROMCHAN "474"
#define ERR_BADCHANNELKEY "475"
#define ERR_BADCHANMASK "476"
#define ERR_NOCHANMODES "477"
#define ERR_BANLISTFULL "478"
#define ERR_NOPRIVILEGES "481"
#define ERR_CHANOPRIVSNEEDED "482"
#define ERR_CANTKILLSERVER "483"
#define ERR_RESTRICTED "484"
#define ERR_UNIQOPPRIVSNEEDED "485"
#define ERR_NOOPERHOST "491"

#define ERR_UMODEUNKNOWNFLAG "501"
#define ERR_USERSDONTMATCH "502"

/*======================*/
/*PROTOCOLO DCC*/
/*======================*/
#define DCC "DCC"
#define DCC_CODE 0x01
#define DCC_CHAT "CHAT"
#define DCC_SEND "SEND"
#define DCC_TALK "TALK"
#define DCC_PORT 8122

#endif /* CONSTANTES_H_ */
